package per.ace.jackson.controller;


import org.springframework.web.bind.annotation.*;
import per.ace.jackson.entity.Order;

import java.util.*;

/**
 * @program: ace-json-starter
 * @description: order web
 * @author: ace
 * @Date: 2020-03-27 11:31
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @GetMapping()
    public List<Order> getOrder(){
        Order o = new Order();
        o.setOrderId(1L);
        o.setUserId(23L);
        o.setItemId(100009186366L);
        o.setItemName("微软 Surface Pro 7");
        o.setCreateTime(new Date());
        List l = new ArrayList();
        l.add(o);
        return l;
    }

    @PostMapping
    public void addOrder(@RequestBody Order order){

        System.out.println(order.toString());
    }

}
